<%@ page contentType="text/html;charset=UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="extLibs" value="grid"/>
<sys:header title="会员缴费记录管理" extLibs="${extLibs}" />
<div class="portlet box ${boxStyleColor}">
	<div class="portlet-title">
		<div class="caption"><i class="fa fa-coffee"></i> 会员缴费记录</div>
		<div class="actions">
			<a href="#" class="btn btn-default btn-sm" id="btnSearch" title="查询"><i class="fa fa-search"></i> 查询</a>
			<shiro:hasPermission name="mih:memberFee:edit">
				<a href="${ctx}/mih/memberFee/form" class="btn btn-default btn-sm btnTool" title="新增会员缴费记录"><i class="fa fa-plus"></i> 新增</a>
			</shiro:hasPermission>
		</div>
	</div>
	<div class="portlet-body list">
		<form:form id="searchForm" modelAttribute="memberFee" action="${ctx}/mih/memberFee/listData" method="post" class="breadcrumb form-inline hide"
				data-page-no="${page.pageNo}" data-page-size="${page.pageSize}" data-order-by="${page.orderBy}">
			<div class="form-group">
				<label class="control-label">会员编码：</label>
				<div class="input-inline">
					<form:input path="memberCode" htmlEscape="false" maxlength="64" class="form-control input-sm width-160"/>
				</div>
			</div>
			<div class="form-group" style="margin-left:10px;"> 
				<input class="btn btn-primary btn-sm" type="submit" value="查询"/>&nbsp;
				<input class="btn default btn-sm" type="reset" value="重置"/>
			</div>
		</form:form>
		<table id="dataGrid"></table>
	    <div id="dataGridPage"></div>
	</div>
</div>
<sys:footer extLibs="${extLibs}" />
<script type="text/javascript">
	// 初始化DataGrid对象
	$("#dataGrid").dataGrid({
		
		searchForm: $("#searchForm"), // 数据来源表单
		tabPageId: '${param.tabPageId}',// 当前页签编号
		
		// 设置数据表格列
		columnModel: [
			{header:'会员编码', name:'memberCode', index:'a.member_code', width:100, align:"left", frozen:true, formatter: function(val, obj, row, act){
				return '<a href="${ctx}/mih/memberFee/form?id='+row.id+'" class="btnList" data-title="编辑会员缴费记录">'+(val ? val : row.id)+'</a>';
			}},
			{header:'会员姓名', name:'memberName', index:'a.member_name', width:100, align:"left"},
			{header:'单位名称', name:'officeName', index:'a.office_name', width:120, align:"left"},
			{header:'开始年月', name:'beginYearMonth', index:'a.begin_year_month', width:60, align:"left"},
			{header:'结束年月', name:'endYearMonth', index:'a.end_year_month', width:60, align:"left"},
			{header:'期数', name:'periods', index:'a.periods', width:60, align:"right"},
			{header:'报销比例', name:'calcRatio', index:'a.calc_ratio', width:60, align:"right"},
			{header:'缴费状态', name:'payStatus', index:'pay_status', width:60, fixed:true, align:"center", formatter: function(val, obj, row, act){
				return getDictLabel(${fns:getDictListJson('pay_status')}, val, '未知', true);
			}},
			{header:'中断年月', name:'breakYearMonth', index:'a.break_year_month', width:60, align:"left"},
			{header:'已缴金额', name:'amount', index:'a.amount', width:100, align:"right"},
			{header:'备注信息', name:'remrks', index:'a.remrks', width:200, align:"left"},
			{header:'更新时间', name:'updateDate', index:'a.update_date', width:200, align:"left"},
			{header:'操作', name:'actions', width:100, fixed:true, sortable:false, formatter: function(val, obj, row, act){
				var actions = [];//<shiro:hasPermission name="mih:memberFee:edit">
				if (row.status == Global.STATUS_NORMAL){
					actions.push('<a href="${ctx}/mih/memberFee/form?id='+row.id+'" class="btnList" title="编辑会员缴费记录"><i class="fa fa-pencil"></i></a>&nbsp;');
					actions.push('<a href="${ctx}/mih/memberFee/delete?id='+row.id+'" class="btnList" title="删除该会员缴费记录" data-confirm="确认要删除该会员缴费记录吗？"><i class="fa fa-trash-o"></i></a>&nbsp;');
					if (row.payStatus == '1'){
					actions.push('<a href="${ctx}/mih/memberFee/stopFee?id='+row.id+'" class="btnList" title="停缴" data-confirm="确认该会员停止缴费吗？"><i class="fa glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
					}
					if (row.payStatus == '2'){
					actions.push('<a href="${ctx}/mih/payRecord/form?memberCode='+row.memberCode+'&&memberName='+row.memberName+'&&feeId='+row.id+'" class="btnList" title="补缴"><i class="fa fa-gavel"></i></a>&nbsp;');
					}
					actions.push('<a href="${ctx}/mih/payRecord/list?memberCode='+row.memberCode+'" class="btnList" title="查看补缴明细"><i class="fa fa-dot-circle-o"></i></a>&nbsp;');


				}//</shiro:hasPermission>
				return actions.join('');
			}}
		],
		ajaxSuccess: function(data){ // 加载成功后执行方法
			
		}
	});
</script>